// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from  './router/active' //动态路由引入
// import router from  './router/index' //动态路由引入
import store from './store' //状态管理引入
import filters from './filter.js' //filters 引入
import base from './assets/js/base.js' //全局函数引入

Vue.config.devtools = false//启用vue-devtools
Vue.config.productionTip = false
//elementUI
Vue.use(ELEMENT)
//过滤器
for(let key in filters){
  Vue.filter(key,filters[key]);
}

//全局注册store
Vue.prototype.$store=store;
//全局注册dingding
Vue.prototype.$dingding=dd;

//全局注册自定义指令  v-focus
Vue.directive('focus',{
	//当绑定的元素插入dom
	inserted : function(el){
		//让原生input框聚焦
		//el.focus()
		//这里要注意的是组件<el-input>本身在页面中渲染成了一个div元素
		el.querySelector('input').focus()
	}
})

Vue.use(base);

/* eslint-disable no-new */
new Vue({
  el: '#app',
  store,//状态管理
  router,
  components: { App },
  template: '<App/>'
})
